<?php

namespace App\Console\Commands;

use App\logic\CsendsmsLogic;
use App\servers\DxbSmsServer;
use App\servers\RlySmsServer;
use App\servers\SmsEntranceServer;
use Illuminate\Console\Command;

class SmsCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:sendsms';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '预约提前半小时发送通知';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $sms = new SmsEntranceServer(new RlySmsServer());//使用短信宝策略
        $user = CsendsmsLogic::visitUserInfo();
        foreach ($user as $key => $value){
            $sms->getStrategy($value->phone);
        }
    }
}
